package com.century.sjt.util;

import android.graphics.Bitmap;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.century.sjt.form.FormImage;
import com.century.sjt.util.volleyUtil.PostUploadRequest;
import com.century.sjt.util.volleyUtil.ResponseListener;

import java.util.ArrayList;
import java.util.List;

//import com.century.sjt.util.volleyUtil.PostUploadRequest;
//import com.century.sjt.util.volleyUtil.ResponseListener;

/**
 * Created by moon.zhong on 2015/3/2.
 */
public class UploadApi {

    /**
     * 上传图片接口
     * @param bitmap 需要上传的图片
     * @param listener 请求回调
     */
    public static void uploadImg(Bitmap bitmap, ResponseListener listener, RequestQueue mRequestQueue){
        List<FormImage> imageList = new ArrayList<FormImage>() ;
        imageList.add(new FormImage(bitmap)) ;
        Request request = new PostUploadRequest(Constant.ImageUploadHost,imageList,listener) ;
//        Request request = new PostUploadRequest("http://192.168.0.188:8080/buding/picture/uploadPhoto",imageList,listener) ;
//        VolleyUtil.getRequestQueue().add(request) ;
        mRequestQueue.add(request);
    }

//    public static void uploadFile(File mFileName,ResponseListener listener,RequestQueue mRequestQueue){
//        List<FormFile> fileList = new ArrayList<FormFile>() ;
//        fileList.add(new FormFile(mFileName)) ;
//        Request request = new PostUploadRequestSound(Constant.UploadHost,fileList,listener) ;
////        VolleyUtil.getRequestQueue().add(request) ;
//        mRequestQueue.add(request);
//    }


}
